/*************************************************************
 * Title: 
 * Description: 
 * Author: Snow Huang
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com
 * CreateTime: 2010-8-2 下午08:35:45
 * Copyright © 落羽社区 All right reserved
 ************************************************************/
package snow.core.domain.enums;

/**
 * 
 */
public enum Gender implements java.io.Serializable {

	Male(Boolean.TRUE, "commons.gender.male"), Female(Boolean.FALSE, "commons.gender.female");

	/**
	 * @param value
	 * @return
	 */
	public static Gender getGender(Boolean value) {
		return value == null ? null : (value.booleanValue() ? Male : Female);
	}

	private Boolean mappingValue;

	private String mappingKey;

	private Gender(Boolean mappingValue, String mappingKey) {
		this.mappingValue = mappingValue;
		this.mappingKey = mappingKey;
	}

	/**
	 * @return the mappingKey
	 */
	public String getMappingKey() {
		return mappingKey;
	}

	/**
	 * @return the mappingValue
	 */
	public Boolean getMappingValue() {
		return mappingValue;
	}

	/**
	 * @return
	 * @see java.lang.Enum#toString()
	 */
	public String toString() {
		return getMappingKey();
	}
}
